package exp.day03;

//实现分数类，完成1/1+1/2+....+1/20的精确值
public class P01App {
    public static void main(String[] args) {
        P01 p1 = new P01();
        for (int i = 1; i <= 20; i++) {
            P01 p2 = new P01(1, i);
            System.out.print(p2+"+");
            p1 = p1.add(p2);
        }
        System.out.println("\b="+(double)p1.up/p1.down);
        System.out.println(p1);
    }
}
